package org.xobo.finance.helper.company.view;

import java.util.Collection;
import java.util.Map;

import org.malagu.panda.coke.utility.Coke;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.xobo.finance.helper.company.entity.Company;

import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.data.provider.Criteria;
import com.bstek.dorado.data.provider.Page;

@Service
@Transactional(readOnly = true)
public class CompanyMaintain {

  @DataProvider
  public void loadCompany(Page<Company> page, Criteria criteria, Map<String, Object> parameterMap) {
    Coke.query(Company.class, criteria, parameterMap).paging(page);
  }
  

  @DataResolver
  @Transactional
  public void saveCompany(Collection<Company> companyList) {
    Coke.save(companyList);
  }
}
